﻿using System.ComponentModel;
using Core.Infrastructure.AnimationService;
using Core.Infrastructure.Settings;
using Microsoft.Practices.Composite.Events;
using Microsoft.Practices.Composite.Presentation.Commands;
using Microsoft.Practices.Unity;
using System.Linq.Expressions;
using System;
using Core.Infrastructure.ModelBase;

namespace Core.Infrastructure.ViewModelBase
{
    /// <summary>
    /// Base class for all the viewmodels
    /// </summary>
    public abstract class ViewModelBase : NotificationObject
    {
        #region Constructors

        protected ViewModelBase(
            IEventAggregator eventAggregator,
            IAnimationService animationService,
            IUnityContainer container, 
            ISettings settings)
        {
            EventAggregator = eventAggregator;
            AnimationService = animationService;
            Container = container;
            Settings = settings;
        }

        #endregion

        #region Properties

        public IEventAggregator EventAggregator { get; set; }
        public IAnimationService AnimationService { get; set; }
        public IUnityContainer Container { get; set; }
        public ISettings Settings { get; set; }

        #endregion

        #region abstract

        public abstract void OnLoad(object obj);
        public abstract void OnUnload(object obj);
        public DelegateCommand<object> Loaded { get; set; }
        public DelegateCommand<object> Unloaded { get; set; }
        public abstract bool IsActive { get; set; }

        #endregion
    }
}
